package cn.framework.mail.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Service;

import cn.framework.mail.SysJmsMailSender;
import cn.framework.mail.model.Mail;

@Service
public class SysJmsMailSenderImpl implements SysJmsMailSender{
	
	@Autowired
	@Qualifier("sysJmsTemplate")
    private JmsTemplate sysJmsTemplate;

	public boolean sendMail(Mail mail)throws Exception {
		try {
			sysJmsTemplate.convertAndSend(mail);
			return true;
		} catch (Exception e) {
			throw e;
		}	
		
	}
}
